#ifndef _P_TFTP_H
#define _P_TFTP_H

#include "Includes.h"
#include "pub_version.h"

#define TFTP_DOWNLOAD_SUCCESS  0
#define TFTP_DOWNLOAD_GETFILE_ERR  1
#define TFTP_DOWNLOAD_CRC_ERR  2
#define TFTP_DOWNLOAD_UNCOMPRESS_ERR  3
#define TFTP_DOWNLOAD_CPUTYPE_ERR  4
#define TFTP_DOWNLOAD_VERSION_MATCH  5
#define TFTP_DOWNLOAD_BACKUP_ERR  6
#define TFTP_DOWNLOAD_DOING  7
#define TFTP_DOWNLOAD_VECTOR_ERR  8
#define TFTP_DOWNLOAD_PROG_ERR  9
#define TFTP_DOWNLOAD_LEN_ERR  10
#define TFTP_DOWNLOAD_FILETYPE_ERR  11
#define TFTP_DOWNLOAD_ERASE_ERR  12
#define TFTP_DOWNLOAD_NOT_MATCH  13
#define TFTP_DOWNLOAD_RRQ_TIMEOUT 14
#define TFTP_DOWNLOAD_TRANS_TIMEOUT 15
#define TFTP_DOWNLOAD_OPCODE_ERR 16

#define TIMEUP_FOR_SEND_VERNO_BY_TFTP  11


typedef __packed union tagT_TftpMsg
{
    T_M_VersionQueryAckByTftp stVersionQueryAckByTftp;
    T_M_DownloadVerAckByTftp stDownloadVerAckByTftp;
    T_M_CtrledDownloadReqByTftp tCtrledDownloadReqByTftp;
}U_TftpMsg;



VOID P_TFTP_CLIENT(INT8U state, INT32U msg, VOID *pPara, WORD16 len, VOID *pVar);
VOID P_TFTP_SERVER(INT8U state, INT32U msg, VOID *pPara, WORD16 len, VOID *pVar);

#endif
